package pers.lx.crm.controller.market;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import pers.lx.crm.base.common.pigeon.Result;
import pers.lx.crm.entiy.market.MarketDO;
import pers.lx.crm.entiy.market.MarketInfoDO;
import pers.lx.crm.entiy.market.MarketListDO;
import pers.lx.crm.service.market.MarketService;

/**
 * Created by lx on 2017/4/26.
 */
@Controller
@RequestMapping(value = "marketInfo")
public class MarketInfoController {

    @Autowired
    private MarketService marketService ;

    @RequestMapping(value = "/list")
    public @ResponseBody
    Result getMarketInfos(@RequestBody MarketDO marketDO){
        return marketService.getMarketInfos(marketDO.getId()) ;
    }

    @RequestMapping(value = "/update")
    public @ResponseBody
    Result updateMarketInfos(@RequestBody MarketListDO marketListDO){
        return marketService.updateMarketInfo(marketListDO.getMarketInfoDOs()) ;
    }

}
